package org.dubbo.consumer;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import lif.dubbo.EchoService;

/**
 * Hello world!
 *
 */
public class App {

	public static void start() throws Exception {
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] { "application.xml" });
		context.start();

		EchoService demoService = (EchoService) context.getBean("echoService"); // 获取远程服务代理
		String hello = demoService.echo("world"); // 执行远程方法
		demoService.say("world");
		System.out.println(hello); // 显示调用结果

	}

	public static void main(String[] args) throws Exception {
		start();
	}

}
